<?php

include("system/core/sessions.class.php");
include("system/users/userAccess.class.php");
include("system/db/dbconnect.class.php");
include("system/display/navdisplay.class.php");

include("system/config/config.php");
$sess = new Session();

$nav = new Navdisplay();

$user = new userAccess();
$user->isLoggedIn(1);

include("system/cart/cart.class.php");
$CART = new Cart();


	
$CART->setPurchaseOrderNumber($_GET['sap']);
$ORDERARRAY = $CART->getOrderFromCart($_SESSION['username']);

if($CART->processOrder($ORDERARRAY)){
header("Location:ordersuccess.php");
}else{
header("Location:ordererror.php");
};





?>